class Calculator{
  def calculate(a:Int,b:Int,str:Char)=str match{
      case '+'=>a+b
      case '-'=>a-b
      case '*'=>a*b
      case '/'=>a/b
      case _=>"Invalid operator"
    
    //println(result)
  }
}
val calculator=new Calculator()
println(calculator.calculate(10,5,'+'))
println(calculator.calculate(10,5,'-'))
println(calculator.calculate(10,5,'*'))
println(calculator.calculate(10,5,'/'))
println(calculator.calculate(5,10,'%'))


